package me.zhengjie.controller;

import lombok.RequiredArgsConstructor;
import me.zhengjie.pojo.dto.AgvRequestLiftDto;
import me.zhengjie.pojo.vo.AgvTaskSubmitVo;
import me.zhengjie.service.AgvReturnService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wcs")
@RequiredArgsConstructor
public class AgvReturnController {
    private static final Logger haikang = LoggerFactory.getLogger("haiKang");

    private final AgvReturnService agvReturnService;

    //AGV请求外设接口
    @PostMapping("/peripherals/report")
    public AgvTaskSubmitVo agvRequestLift(@RequestBody AgvRequestLiftDto agvRequestLiftDto) throws Exception {
        haikang.info("请求外设接口回报：{}",agvRequestLiftDto);
        AgvTaskSubmitVo agvTaskSubmitVo = agvReturnService.agvRequestLift(agvRequestLiftDto);
        return agvTaskSubmitVo;
//        return AgvTaskSubmitVo.OK(agvRequestLiftDto.getTaskCode());
    }


}
